The present invention generally relates to database management systems, and more particularly, to administering a partitioned database.
A database is partitioned primarily for administrative purposes, wherein a partition is defined in terms of a range of keys, either primary or secondary, to records in a table. Partitions allow a database administrator (DBA) to add, delete, or change information for a range of records in a table. For example, if some data within a partition of the table is no longer valid, the DBA can remove the partition that contains invalid data and then restore the valid data to the partition. Without partitions, the DBA would have to remove the entire table and restore the valid data, thereby making the entire database inaccessible to users. The partitions allow a user to continue to access some portions of a table while another portion of it has been removed for maintenance.
For some database applications, such as a data warehouse, users are typically limited to selecting records according to user-specified selection criteria. Thus, users are not permitted to insert, update, or delete records from the data warehouse. Data warehouses also tend to have very large storage requirements, often in the terabyte range. The large storage requirements can lead to more active administration of the partitions of the database. That is, partition ranges may need to be actively managed.
Removing a partition for administrative purposes may be appropriate in some circumstances, for example, when the partition contains invalid data. Since the data is invalid, user visibility of the data is undesirable. In other circumstances, however, removing a partition may be undesirable since user visibility of the data is important. For example, if an administrator is realigning partitions, in a data warehouse, users may require continued visibility of the records in the subject partitions.
A method and apparatus that addresses the aforementioned problems, as well as other related problems, are therefore desirable.
A method and apparatus for managing a database having a plurality of partitions are provided in various embodiments. The database is managed by users of a first user class and accessible to users of a second user class. Respective partition states are established for the partitions of the database, and access is provided to users of the first user class to partitions having a first partition state. Users of the second user class are denied access to partitions having the first partition state, and users of the second user class are provided access to partitions having a second partition state.
In accordance with another embodiment of the invention, a computer program product is provided to be operable to manage a database having a plurality of partitions, wherein the database is managed by users of a first user class and accessible to users of a second user class The above summary of the present invention is not intended to describe each disclosed embodiment of the present invention. The figures and detailed description that follow provide additional example embodiments and aspects of the present invention.